<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="IResourceBundle,mx.resources.IResourceBundle,bundleName,content,locale" name="keywords">
<title>mx.resources.IResourceBundle</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'IResourceBundle - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/resources/IResourceBundle.html&amp;mx/resources/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Interface&nbsp;IResourceBundle</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Interface IResourceBundle"); titleBar_setSubNav(false,true,false,false,false,false,false,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.resources</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Interface</td><td class="classSignature">public interface IResourceBundle</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implementors</td><td><a href="../resources/ResourceBundle.html">ResourceBundle</a></td>
</tr>
</table>
<p></p>
  The IResourceBundle and IResourceManager interfaces work together
  to provide localization support for Flex applications.
   <p>There are three main concepts involved in localization:
  locales, resources, and resource bundles.</p>
   <p>A locale specifies a language and a country
  for which your application has been localized.
  For example, the locale <code>"en_US"</code>
  specifies English as spoken in the United States.
  (See the mx.resources.Locale class for more information.)</p>
   <p>A resource is a named value that is locale-dependent.
  For example, your application might have a resource
  whose name is <code>"OPEN"</code>
  and whose value for an English locale is <code>"Open"</code>
  but whose value for a French locale is <code>"Ouvrir"</code>.</p>
   <p>A resource bundle is a named group of resources
  whose values have been localized for a particular locale.
  A resource bundle is identified by the combination of its
  <code>bundleName</code> and its <code>locale</code>,
  and has a <code>content</code> Object that contains
  the name-value pairs for the bundle's resources.</p>
   <p>The IResourceBundle interface represents a specific resource bundle.
  However, most applications will only need to use IResourceManager.
  A single ResourceManager object implementing this interface
  manages multiple resource bundles, possibly for multiple locales,
  and provides access to the resources that they contain.
  For example, you can retrieve a specific resource as a String by calling
  <code>resourceManager.getString(bundleName, resourceName)</code>.
  By changing the <code>localeChain</code> property of the ResourceManager,
  you can change which resource bundles are searched for resource values.</p>
   <p>Generally, you do not create resource bundles yourself;
  instead, they are usually compiled from *.properties files.
  A properties file named MyResources.properties
  produces a resource bundle with <code>"MyResources"</code>
  for its <code>bundleName</code>.
  You generally produce multiple versions of each properties file,
  one for each locale that your application supports.</p>
   <p>Flex properties files are similar to Java properties files,
  except that they also support MXML's <code>Embed()</code>
  and <code>ClassReference()</code> directives.
  These directives work the same way in a properties file
  as they do in a CSS file, producing class references.
  Also, the encoding for Flex properties files
  is always assumed to be UTF-8.</p>
   <p>The Flex framework's resources have been localized
  for U.S. English (the <code>"en_US"</code> locale) and
  for Japanese (the <code>"ja_JP"</code> locale). 
  The framework resources are organized into multiple bundles
  corresponding to framework packages; for example, the "formatters"
  bundle is used by classes in the mx.formatters package.
  (There is also a "SharedResources" bundle for resources used by
  multiple packages.)</p>
   <p>The properties files for the framework resources,
  such as formatters.properties, can be found in the
  frameworks/projects/framework/bundles/{locale}/src directories
  of the Flex SDK.
  Your applications normally link against the Flex framework
  as a precompiled library, framework.swc,
  in the frameworks/libs directory.
  This library has no resources in it.
  Instead, the framework resources have been compiled into separate
  resource bundle libraries such as framework_rb.swc.
  These are located in the frameworks/locales/{locale} directories
  and your application must also link in one or more of these.</p>
   <p>You are free to organize your application's own resources
  into whatever bundles you find convenient.
  If you localize your application for locales
  other than <code>"en_US"</code> and <code>"ja_JP"</code>,
  you should localize the framework's properties files for those locales
  as well and compile additional resource bundle libaries for them.</p>
   <p>When your application starts, the ResourceManager is automatically
  populated with whatever resource bundles were compiled
  into the application.
  If you create a code module, by default the resources that its classes
  need are compiled into the module.
  When the module is loaded into an application, any bundles that the
  application does not already have are added to the ResourceManager.</p>
   <p>You can compile "resource modules" that have only resources in them,
  and load them with the <code>loadResourceModule()</code> method
  of the ResourceManager.
  With resource modules, you can support multiple locales by loading
  the resources you need at run time rather than compiling them into
  your application.</p>
   <p>Although the ResourceManager is normally populated with resource bundles
  that were compiled into your application or loaded from modules,
  you can also programmatically create resource bundles and add them
  to the ResourceManager yourself with the <code>addResourceBundle()</code>
  method.</p>
   <p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../resources/ResourceBundle.html" target="">mx.resources.ResourceBundle</a>
<br>
<a href="../resources/IResourceManager.html" target="">mx.resources.IResourceManager</a>
<br>
<a href="../resources/ResourceManager.html" target="">mx.resources.ResourceManager</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bundleName">bundleName</a> : String<div class="summaryTableDescription">[read-only]
      A name that identifies this resource bundle,
      such as <code>"MyResources"</code>.</div>
</td><td class="summaryTableOwnerCol">IResourceBundle</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#content">content</a> : Object<div class="summaryTableDescription">[read-only]
      An object containing key-value pairs for the resources
      in this resource bundle.</div>
</td><td class="summaryTableOwnerCol">IResourceBundle</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#locale">locale</a> : String<div class="summaryTableDescription">[read-only]
      The locale for which this bundle's resources have been localized.</div>
</td><td class="summaryTableOwnerCol">IResourceBundle</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="bundleName"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bundleName</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>bundleName:String</code>&nbsp;&nbsp;[read-only]<p>
      A name that identifies this resource bundle,
      such as <code>"MyResources"</code>.
           </p><p>This read-only property is set
      when a resource bundle is constructed.</p>
           <p>Resource bundles that are automatically created from compiled
      properties files have bundle names based on the names of those files.
      For example, a properties file named MyResources.properties
      will produce a resource bundle whose <code>bundleName</code>
      is <code>"MyResources"</code>.</p>
           <p>The ResourceManager can manage multiple bundles with the same
      <code>bundleName</code> as long as they have different values
      for their <code>locale</code> property.</p>
     <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get bundleName():String</code>
<br>
</div>
<a name="content"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">content</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>content:Object</code>&nbsp;&nbsp;[read-only]<p>
      An object containing key-value pairs for the resources
      in this resource bundle.
           </p><p>In general, you should access resources by using IResourceManager
      methods such as <code>getString()</code>, rather than directly
      accessing them in a resource bundle.
      However, if you are programmatically creating your own
      resource bundles, you can initialize them with resources,
      as follows:</p>
           <pre>
      var rb:IResourceBundle = new ResourceBundle("fr_FR", "MyResources");
      rb.content["LANGUAGE"] = "Francais";
      rb.content["GREETING"] = "Bonjour";
      </pre>
           <p>When a resource bundle is produced by compiling a properties
      file, its resource values are either of type String or Class.
      For example, if the properties file contains</p>
           <pre>
      LANGUAGE=English
      MINIMUM_AGE=18
      ENABLED=true
      LOGO=Embed("logo.png")
      </pre>
           <p>then the value of the <code>LANGUAGE</code> resource
      is the String <code>"English"</code>,
      the value of the <code>MINIMUM_AGE</code> resource
      is the String <code>"18"</code>,
      the value of the <code>ENABLED</code> resource
      is the String <code>"true"</code>,
      and the value of the <code>LOGO</code> resource
      is a Class that represents the embedded PNG file.</p>
           <p>You can use IResourceManager methods such as <code>getInt()</code>
      and <code>getBoolean()</code> to convert resource strings like
      <code>"18"</code> and <code>"true"</code> into the type
      that your code expects.</p>
     <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get content():Object</code>
<br>
</div>
<a name="locale"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">locale</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>locale:String</code>&nbsp;&nbsp;[read-only]<p>
      The locale for which this bundle's resources have been localized.
      This is a String such as <code>"en_US"</code> for U.S. English.
           </p><p>This read-only property is set
      when a resource bundle is constructed.</p>
           <p>Resource bundles that are automatically created from compiled
      properties files have locales based on the
      <code>-compiler.locale</code> option of the mxmlc or compc compilers.
      For example, suppose that you compile your application with the option
      <code>-compiler.locale=en_US,ja_JP</code> and that you have specified
      <code>-compiler.source-path=resources/{locale}</code> so that
      your application's resources, located in
      resources/en_US/MyResources.properties and
      resources/ja_JP/MyResources.properties, are found.
      Then your application will have two resource bundles
      whose <code>bundleName</code> is <code>"MyResources"</code>,
      one whose <code>locale</code> is <code>"en_US"</code> 
      and one whose <code>locale</code> is <code>"ja_JP"</code>.</p>
     <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get locale():String</code>
<br>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
